<?php
 /**
  *  @package ARXLib
  *  @version 2
  *  @subpackage Inputs
  *
  *  @copyright Ringo-Web Inc. 2004 - 2005
  */

    class CARXCheckbox extends CARXInput
    {
		var $readonly;
	
        function CARXCheckbox($label, $dbFieldName = "", $readonly = false)
        {
            parent::CARXInput($label, $dbFieldName);
	    	$this->readonly = $readonly;
        }

        function GetHTML()
        {         
            $checked = "";
            if ($this->m_value)
            {
                $checked = " checked";
            }

            $readonly = "";
            if ($this->readonly)
            {
                $readonly = " disabled";
            }
	    
            return $result = "<input type=\"checkbox\" name=\"$this->m_dbFieldName\" value=\"1\"$checked$readonly>\n";
        }
    }
?>